package com.demoo.zjsu.service.smartwebsite.zhaoban;

import com.demoo.zjsu.model.smartwebsite.PageTwo;
import com.demoo.zjsu.service.smartwebsite.Page;
import com.demoo.zjsu.service.smartwebsite.zjgsu.IndexPageService;
import com.demoo.zjsu.util.annotaion.Log;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.stereotype.Service;

/**
 * Created by jshjsh on 2016/9/9.
 */

@Service
public class IndexPage2 extends IndexService{


    @Override
    public Elements getMain(Document document) {
        Elements elements = document.select("[width=104%]").eq(1).select("tr");
        for (Element element : elements) {
            element.select(".HSAColLink").remove();
        }

        return elements;
    }


    @Override
    public Page getPage() {
        return new Page("http://zhaoban.zjsu.edu.cn/indexzb.asp","报考指南");
    }


    @Override
    public PageTwo dealTitle(String url, String title) {
        url = url.replace("html", "").substring(3);
        return new PageTwo(title, "", url, 0);
    }
}
